﻿@{
    SiteSecurity.RequireAuthenticatedUser();
    if (Roles.IsUserInRole(UsersRoles.User))
    {
        Response.Redirect("~/");
    }
    if (!Roles.IsUserInRole(UsersRoles.Admin))
    {
        Response.Redirect("~/Account/Login");
    }
}
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8" content="" />
    <title>@WebSite.Name - @Page.Title</title>
    <link href="@Href("~/Styles/Site.css")" rel="stylesheet" />
    <link href="@Href("~/favicon.ico")" rel="shortcut icon" type="image/x-icon" />
    <link href="@Href("~/Styles/SiteCustom.css")" rel="stylesheet" />
</head>
<body>
    <div id="page">
        <div id="header">
            <p class="site-title">
                @WebSite.Name
            </p>
            @RenderPage("~/Account/_Login.cshtml")
            <ul id="menu">
                <li><a href="@Href("~/Admin")">Home</a></li>
                <li><a href="@Href("~/Admin/AddQuestionType")">Add Question Type</a></li>
                <li><a href="@Href("~/Admin/ViewQuestionType")">View Question Type</a></li>
                <li><a href="@Href("~/Admin/AddQuestion")">Add Question</a></li>
                <li><a href="@Href("~/Admin/ViewQuestion")">View Question</a></li>
                @*<li><a href="@Href("~/Admin/AdminResult")">Result</a></li>*@
                <li><a href="@Href("~/Admin/ManageRoles")">Manage Roles</a></li>
            </ul>
        </div>
        <div id="main">
            <div id="content">
                @*<h1>@Page.Title</h1>*@
                @RenderBody()
            </div>
        </div>
        @RenderPage("~/Shared/_Footer.cshtml")
    </div>
</body>
</html>